<?php // ccl.php -- available computer info for the CCL

// Start with output buffering and includes
ob_start();
require_once("../init.php");
require_once("../../tcdb/html/init.php");

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      <head>
	<title>Creative Computing Lab</title>
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
	
	<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
	<meta name="author" content="Dylan J. Sather" />
	<meta name="revised" content= <?php

	/* This script checks the date_modified file to give the date at which a file on the 
	   map was last modified, thus giving us the date at which the map was last revised */

	$date_file = "/home/satherdy/map_files/ccl_date_modified";
	$fh = fopen($date_file, 'r');
	$date = fread($fh, filesize($date_file));
	$date = trim($date);
	fclose($fh);
	print "\"Dylan J. Sather, $date\" />";

	?>

	<meta name="description" content="Grinnell College Campus Technology Map" />
	<meta name="keywords"
		content="Grinnell College, TC Corps, Technology Consultant,
			Computer lab, Map, Dylan J. Sather, Creative Computing Lab" />
	<meta http-equiv="Content-Style-Type" content="text/css" />
	<meta http-equiv="Content-Script-Type" content="text/javascript" />
	<link rel="stylesheet" type="text/css" href="../css/labmap.css" />
	<link rel="stylesheet" type="text/css" href="../css/labs.css" />
	<link rel="stylesheet" type="text/css" href="../css/labs/ccl.css" />

	<!-- IE8 fixed CSS issues, so we only want to use the IE styles on <= IE7 --> 
	<!--[if lte IE 7]>
		<link rel="stylesheet" type="text/css" href="../css/ie.css" />
	<![endif]-->
      </head>

      <body>
	<div class="wrapper"> <!-- Start WRAPPER DIV -->
	  <h1>Creative Computing Lab</h1>
	    <p>Below, you'll find information on available computers in the CCL</p>
	
	    <div id="ccl"> <!-- Start CCL div -->

	    <?php 

	      // MySQL query to retrieve CCL computer information

              $query = mysql_query("SELECT * FROM available_comps
                                    WHERE lab='ccl'");

              while ($row = mysql_fetch_array($query))
                {
                  print "
	      <div class=\"$row[id] ";
		
		  if ($row[comp_on])
		    {
		      print "unavailable_comp\">
	      <div class=\"popup_unavailable\">
	      <div class=\"inside\">
	      <div class=\"text\"><p>$row[id] is in use</p>";
		    }
		  else
	 	    {
		       print "available_comp\">
	      <div class=\"popup_available\">
	      <div class=\"inside\">
	      <div class=\"text\"><p>$row[id] is available</p>";
		    }
		
		  print "
	      </div> <!-- End \"text\" div -->
	      </div> <!-- End \"inside\" div -->
	      </div> <!-- End \"popup\" div -->
	      </div> <!-- End \"computer\" div -->\n";
                }

            ?>

	  </div> <!-- End CCL div -->
	</div> <!-- End WRAPPER div -->
      </body>

</html>
